import request from '@/utils/request'
import { getItem } from '@/utils/auth'

export function fetchParameterSite(data) {
  return request({
    url: '/cloud-system/getParameterSiteList',
    method: 'post',
    data
  })
}

export function fetchParameterSiteDetail(data) {
  return request({
    url: '/cloud-system/getOneParameterSiteDetail',
    method: 'post',
    data
  })
}

export function createOneParameterSite(data) {
  return request({
    url: '/cloud-system/createOneParameterSite',
    method: 'post',
    data
  })
}

export function updateParameterSite(data) {
  return request({
    url: '/cloud-system/updateOneParameterSite',
    method: 'post',
    data
  })
}

export function deleteOneParameterSite(data) {
  return request({
    url: '/cloud-system/deleteOneParameterSite',
    method: 'post',
    data
  })
}
export function batchDeleteParameterSite(data) {
  return request({
    url: '/cloud-system/batchDeleteParameterSite',
    method: 'post',
    data
  })
}

export function lockParameterSite(data) {
  return request({
    url: '/cloud-system/lockOneParameterSite',
    method: 'post',
    data
  })
}

export function unlockParameterSite(data) {
  return request({
    url: '/cloud-system/unlockOneParameterSite',
    method: 'post',
    data
  })
}

export function batchLockParameterSite(data) {
  return request({
    url: '/cloud-system/batchLockParameterSite',
    method: 'post',
    data
  })
}

export function batchUnLockParameterSite(data) {
  return request({
    url: '/cloud-system/batchUnLockParameterSite',
    method: 'post',
    data
  })
}

export function createParameterSystemList(data) {
  return request({
    url: '/cloud-system/createParameterSystemList',
    method: 'post',
    data
  })
}

export function createParameterOrganizationList(data) {
  return request({
    url: '/cloud-system/createParameterOrganizationList',
    method: 'post',
    data
  })
}

export function createParameterSiteList(data) {
  return request({
    url: '/cloud-system/createParameterSiteList',
    method: 'post',
    data
  })
}

export function createParameterApplicationList(data) {
  return request({
    url: '/cloud-system/createParameterApplicationList',
    method: 'post',
    data
  })
}

export function createParameterUserList(data) {
  return request({
    url: '/cloud-system/createParameterUserList',
    method: 'post',
    data
  })
}

export function deleteObjectByParameterID(data) {
  return request({
    url: '/cloud-system/deleteObjectByParameterID',
    method: 'post',
    data
  })
}

export function getParameterList(baseParam) {
  const data = Object.assign(JSON.parse(getItem('baseParam')), baseParam)
  return request({
    url: '/cloud-system/getParameterList',
    method: 'post',
    data: data
  })
}

